<!-- 以下内容为Vue3语法的组合式API写法 -->
<template>
  <h1 ref='title'>我是父类</h1>
  <button @click="me">点我</button>
  <button @click="test">测试</button>
  <Person ref="ren" />
</template>

<script lang="ts" setup>
import Person from './components/Person.vue';
import { ref } from 'vue'

let title = ref()

let ren = ref()

function me() {
  console.log(title.value)
}

function test() {
  console.log(ren.value)
}

</script>

<style>
/* 组件样式 */
.app {
  background-color: #ddd;
  box-shadow: 0 0 10px;
  border-radius: 10px;
  padding: 20px;
}
</style>
